package com.springboot.xxljob;

import com.springboot.service.DdnsClient;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;


/**
 * @Classname ModifyDomainNameTask
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/6/5 10:48
 * @Created by zyj
 */
@Slf4j
@Component
public class AliYunDomainNameTask {

    @Autowired
    private  DdnsClient ddnsClient;

    /*
     * 方法描述 动态解析域名公网ip
     * @since: 1.0
     * @return: void
     * @author: zyj
     * @date: 2023/6/5
     */
    @XxlJob("checkDomainNameValue")
    public void checkDomainNameValue(){

        try {
            ddnsClient.refreshDdns();
        } catch (Exception e) {
            log.error("checkDomainNameValue error:", e);
        }
    }

}
